package miku.firstgame.model.gold.card
{
	import miku.firstgame.model.gold.interfaces.ICard;
	import miku.firstgame.model.gold.util.CardUtil;
	import miku.firstgame.net.ByteArrayEx;

	public class Card implements ICard
	{

		private var _type:int;

		private var _name:String;

		public function Card(type:int)
		{
			_type = type;
		}

		public function get name():String
		{
			return _name;
		}

		public function set name(value:String):void
		{
			_name = value;
		}

		public function get type():int
		{
			return _type;
		}

		public static function parseCard(data:ByteArrayEx):Card
		{
			var type:int = data.readInt();
			var card:Card = CardUtil.parseCardByType(type);
			return card;
		}

	}
}
